-- character_profiles.lua
-- define table of all characters
Character = class('Character')

function Character:initialize(name, profile)

	print("initializing character named " .. name)

	self.name = name

	local pfile = self:load_profile(name)
	if profile then
		self:set_profile(profile)
	elseif pfile then
		self:set_profile(pfile)
	else
		self:set_profile()
	end

	print("New character with stats:\n" .. "buff_wand: " .. self.buff_wand .. "\n"..
		"buff_shield: " .. self.buff_shield .. "\n")


end

function Character:set_profile(profile)
	print("setting profile, if no profile specified will use blanks")
	self.buff_wand = profile.buff_wand or ""
	self.buff_shield = profile.buff_shield or ""
	self.buff_armor_list = profile.buff_armor_list or {}
	self.buff_item_list = profile.buff_item_list or {}
	self.buff_shield_list = profile.buff_shield_list or {}
	self.buff_life_list = profile.buff_life_list or {}

end

function Character:get_profile()

	local info = {
		self.buff_wand,
		self.buff_shield,
		self.buff_armor_list,
		self.buff_shield_list,
		self.buff_item_list,
		self.buff_life_list
	}

	return info

end



function Character:load_profile(name)

	if name == "Sho-Zan" then
		print("profile for sho-zan loaded")
		local player = require'profiles.Sho-Zan'
		return player
	end
end





